﻿using System.Collections.Generic;

namespace Phoenix.Xna.Framework.Components
{
    public class UpdateOrderComparer : IComparer<IComponent>
    {
        public int Compare(IComponent componentOne, IComponent componentTwo)
        {
            if (componentOne.UpdateOrder < componentTwo.UpdateOrder)
            {
                return -1;
            }
            else if (componentOne.UpdateOrder > componentTwo.UpdateOrder)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
}
